namespace Admin2505.Application.Common;

public class ApiResult
{
    public int Code {get;set;}
    public string Msg {get;set;}=null!;

    public object? Data{get;set;}

    public static ApiResult Sucess(object date,string msg="操作成功")
    {
        var res = new ApiResult{Code=1000,Msg=msg,Data = date};
        return res;
    }
    public static ApiResult Fail(int code =40040,string msg = "操作失败")
    {
        var res = new ApiResult {Code=code,Msg=msg,Data =null };
        return res; 
    }
}